<template>
  <div>
    <iframe
      v-if="openUrl"
      :src="openUrl"
      frameborder="0"
      marginheight="0"
      marginwidth="0"
      style="width: 80%; height: 95%; margin: 20px 10%"
    ></iframe>
  </div>
</template>

<script lang="ts">
import { defineComponent, onMounted, ref, watch } from 'vue';
import { useRoute } from 'vue-router';
export default defineComponent({
  setup() {
    const route = useRoute();
    const openUrl = ref<any>('');
    watch(
      () => route.fullPath,
      () => {
        openUrl.value = route.query.path;
      }
    );
    onMounted(() => {
      openUrl.value = route.query.path;
    });
    return { openUrl };
  }
});
</script>

<style scoped lang="less"></style>
